import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/emergency/emergency_event_list_entity.dart';
import 'package:enterprise_v6_app/app/data/common/choice_bean.dart';


EmergencyEventListEntity $EmergencyEventListEntityFromJson(Map<String, dynamic> json) {
  final EmergencyEventListEntity emergencyEventListEntity = EmergencyEventListEntity();
  final String? accidentAnswerType = jsonConvert.convert<String>(json['accidentAnswerType']);
  if (accidentAnswerType != null) {
    emergencyEventListEntity.accidentAnswerType = accidentAnswerType;
  }
  final List<String>? accidentDevice = (json['accidentDevice'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (accidentDevice != null) {
    emergencyEventListEntity.accidentDevice = accidentDevice;
  }
  final String? accidentDeviceName = jsonConvert.convert<String>(json['accidentDeviceName']);
  if (accidentDeviceName != null) {
    emergencyEventListEntity.accidentDeviceName = accidentDeviceName;
  }
  final String? accidentGrade = jsonConvert.convert<String>(json['accidentGrade']);
  if (accidentGrade != null) {
    emergencyEventListEntity.accidentGrade = accidentGrade;
  }
  final String? accidentGradeLabel = jsonConvert.convert<String>(json['accidentGradeLabel']);
  if (accidentGradeLabel != null) {
    emergencyEventListEntity.accidentGradeLabel = accidentGradeLabel;
  }
  final String? accidentName = jsonConvert.convert<String>(json['accidentName']);
  if (accidentName != null) {
    emergencyEventListEntity.accidentName = accidentName;
  }
  final String? accidentPlaceLatitude = jsonConvert.convert<String>(json['accidentPlaceLatitude']);
  if (accidentPlaceLatitude != null) {
    emergencyEventListEntity.accidentPlaceLatitude = accidentPlaceLatitude;
  }
  final String? accidentPlaceLongitude = jsonConvert.convert<String>(json['accidentPlaceLongitude']);
  if (accidentPlaceLongitude != null) {
    emergencyEventListEntity.accidentPlaceLongitude = accidentPlaceLongitude;
  }
  final List<String>? accidentScenePhotos = (json['accidentScenePhotos'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (accidentScenePhotos != null) {
    emergencyEventListEntity.accidentScenePhotos = accidentScenePhotos;
  }
  final String? accidentStartDate = jsonConvert.convert<String>(json['accidentStartDate']);
  if (accidentStartDate != null) {
    emergencyEventListEntity.accidentStartDate = accidentStartDate;
  }
  final String? accidentType = jsonConvert.convert<String>(json['accidentType']);
  if (accidentType != null) {
    emergencyEventListEntity.accidentType = accidentType;
  }
  final String? accidentTypeLabel = jsonConvert.convert<String>(json['accidentTypeLabel']);
  if (accidentTypeLabel != null) {
    emergencyEventListEntity.accidentTypeLabel = accidentTypeLabel;
  }
  final String? answerPoliceId = jsonConvert.convert<String>(json['answerPoliceId']);
  if (answerPoliceId != null) {
    emergencyEventListEntity.answerPoliceId = answerPoliceId;
  }
  final String? answerPoliceName = jsonConvert.convert<String>(json['answerPoliceName']);
  if (answerPoliceName != null) {
    emergencyEventListEntity.answerPoliceName = answerPoliceName;
  }
  final String? callPoliceId = jsonConvert.convert<String>(json['callPoliceId']);
  if (callPoliceId != null) {
    emergencyEventListEntity.callPoliceId = callPoliceId;
  }
  final String? callPoliceName = jsonConvert.convert<String>(json['callPoliceName']);
  if (callPoliceName != null) {
    emergencyEventListEntity.callPoliceName = callPoliceName;
  }
  final String? callPolicePhone = jsonConvert.convert<String>(json['callPolicePhone']);
  if (callPolicePhone != null) {
    emergencyEventListEntity.callPolicePhone = callPolicePhone;
  }
  final List<dynamic>? chemicalType = (json['chemicalType'] as List<dynamic>?)?.map(
          (e) => e).toList();
  if (chemicalType != null) {
    emergencyEventListEntity.chemicalType = chemicalType;
  }
  final String? chemicalTypeNameList = jsonConvert.convert<String>(json['chemicalTypeNameList']);
  if (chemicalTypeNameList != null) {
    emergencyEventListEntity.chemicalTypeNameList = chemicalTypeNameList;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    emergencyEventListEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    emergencyEventListEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    emergencyEventListEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    emergencyEventListEntity.createDate = createDate;
  }
  final int? deathNum = jsonConvert.convert<int>(json['deathNum']);
  if (deathNum != null) {
    emergencyEventListEntity.deathNum = deathNum;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    emergencyEventListEntity.deleted = deleted;
  }
  final String? handleState = jsonConvert.convert<String>(json['handleState']);
  if (handleState != null) {
    emergencyEventListEntity.handleState = handleState;
  }
  final String? handleStateLabel = jsonConvert.convert<String>(json['handleStateLabel']);
  if (handleStateLabel != null) {
    emergencyEventListEntity.handleStateLabel = handleStateLabel;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    emergencyEventListEntity.id = id;
  }
  final int? minorWoundNum = jsonConvert.convert<int>(json['minorWoundNum']);
  if (minorWoundNum != null) {
    emergencyEventListEntity.minorWoundNum = minorWoundNum;
  }
  final String? policeAnswerDate = jsonConvert.convert<String>(json['policeAnswerDate']);
  if (policeAnswerDate != null) {
    emergencyEventListEntity.policeAnswerDate = policeAnswerDate;
  }
  final String? schedulingStatus = jsonConvert.convert<String>(json['schedulingStatus']);
  if (schedulingStatus != null) {
    emergencyEventListEntity.schedulingStatus = schedulingStatus;
  }
  final int? seriousInjuryNum = jsonConvert.convert<int>(json['seriousInjuryNum']);
  if (seriousInjuryNum != null) {
    emergencyEventListEntity.seriousInjuryNum = seriousInjuryNum;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    emergencyEventListEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    emergencyEventListEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    emergencyEventListEntity.updateDate = updateDate;
  }
  final bool? isChecked = jsonConvert.convert<bool>(json['isChecked']);
  if (isChecked != null) {
    emergencyEventListEntity.isChecked = isChecked;
  }
  final String? videoPath = jsonConvert.convert<String>(json['videoPath']);
  if (videoPath != null) {
    emergencyEventListEntity.videoPath = videoPath;
  }
  return emergencyEventListEntity;
}

Map<String, dynamic> $EmergencyEventListEntityToJson(EmergencyEventListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['accidentAnswerType'] = entity.accidentAnswerType;
  data['accidentDevice'] = entity.accidentDevice;
  data['accidentDeviceName'] = entity.accidentDeviceName;
  data['accidentGrade'] = entity.accidentGrade;
  data['accidentGradeLabel'] = entity.accidentGradeLabel;
  data['accidentName'] = entity.accidentName;
  data['accidentPlaceLatitude'] = entity.accidentPlaceLatitude;
  data['accidentPlaceLongitude'] = entity.accidentPlaceLongitude;
  data['accidentScenePhotos'] = entity.accidentScenePhotos;
  data['accidentStartDate'] = entity.accidentStartDate;
  data['accidentType'] = entity.accidentType;
  data['accidentTypeLabel'] = entity.accidentTypeLabel;
  data['answerPoliceId'] = entity.answerPoliceId;
  data['answerPoliceName'] = entity.answerPoliceName;
  data['callPoliceId'] = entity.callPoliceId;
  data['callPoliceName'] = entity.callPoliceName;
  data['callPolicePhone'] = entity.callPolicePhone;
  data['chemicalType'] = entity.chemicalType;
  data['chemicalTypeNameList'] = entity.chemicalTypeNameList;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deathNum'] = entity.deathNum;
  data['deleted'] = entity.deleted;
  data['handleState'] = entity.handleState;
  data['handleStateLabel'] = entity.handleStateLabel;
  data['id'] = entity.id;
  data['minorWoundNum'] = entity.minorWoundNum;
  data['policeAnswerDate'] = entity.policeAnswerDate;
  data['schedulingStatus'] = entity.schedulingStatus;
  data['seriousInjuryNum'] = entity.seriousInjuryNum;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['isChecked'] = entity.isChecked;
  data['videoPath'] = entity.videoPath;
  return data;
}

extension EmergencyEventListEntityExtension on EmergencyEventListEntity {
  EmergencyEventListEntity copyWith({
    String? accidentAnswerType,
    List<String>? accidentDevice,
    String? accidentDeviceName,
    String? accidentGrade,
    String? accidentGradeLabel,
    String? accidentName,
    String? accidentPlaceLatitude,
    String? accidentPlaceLongitude,
    List<String>? accidentScenePhotos,
    String? accidentStartDate,
    String? accidentType,
    String? accidentTypeLabel,
    String? answerPoliceId,
    String? answerPoliceName,
    String? callPoliceId,
    String? callPoliceName,
    String? callPolicePhone,
    List<dynamic>? chemicalType,
    String? chemicalTypeNameList,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    int? deathNum,
    String? deleted,
    String? handleState,
    String? handleStateLabel,
    String? id,
    int? minorWoundNum,
    String? policeAnswerDate,
    String? schedulingStatus,
    int? seriousInjuryNum,
    String? updateBy,
    String? updateById,
    String? updateDate,
    bool? isChecked,
    String? videoPath,
  }) {
    return EmergencyEventListEntity()
      ..accidentAnswerType = accidentAnswerType ?? this.accidentAnswerType
      ..accidentDevice = accidentDevice ?? this.accidentDevice
      ..accidentDeviceName = accidentDeviceName ?? this.accidentDeviceName
      ..accidentGrade = accidentGrade ?? this.accidentGrade
      ..accidentGradeLabel = accidentGradeLabel ?? this.accidentGradeLabel
      ..accidentName = accidentName ?? this.accidentName
      ..accidentPlaceLatitude = accidentPlaceLatitude ?? this.accidentPlaceLatitude
      ..accidentPlaceLongitude = accidentPlaceLongitude ?? this.accidentPlaceLongitude
      ..accidentScenePhotos = accidentScenePhotos ?? this.accidentScenePhotos
      ..accidentStartDate = accidentStartDate ?? this.accidentStartDate
      ..accidentType = accidentType ?? this.accidentType
      ..accidentTypeLabel = accidentTypeLabel ?? this.accidentTypeLabel
      ..answerPoliceId = answerPoliceId ?? this.answerPoliceId
      ..answerPoliceName = answerPoliceName ?? this.answerPoliceName
      ..callPoliceId = callPoliceId ?? this.callPoliceId
      ..callPoliceName = callPoliceName ?? this.callPoliceName
      ..callPolicePhone = callPolicePhone ?? this.callPolicePhone
      ..chemicalType = chemicalType ?? this.chemicalType
      ..chemicalTypeNameList = chemicalTypeNameList ?? this.chemicalTypeNameList
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deathNum = deathNum ?? this.deathNum
      ..deleted = deleted ?? this.deleted
      ..handleState = handleState ?? this.handleState
      ..handleStateLabel = handleStateLabel ?? this.handleStateLabel
      ..id = id ?? this.id
      ..minorWoundNum = minorWoundNum ?? this.minorWoundNum
      ..policeAnswerDate = policeAnswerDate ?? this.policeAnswerDate
      ..schedulingStatus = schedulingStatus ?? this.schedulingStatus
      ..seriousInjuryNum = seriousInjuryNum ?? this.seriousInjuryNum
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..isChecked = isChecked ?? this.isChecked
      ..videoPath = videoPath ?? this.videoPath;
  }
}
